<div class="blazorise-codeblock">
<div class="csharp"><pre>
<span class="atSign">&#64;</span>code {
    Validations loginValidationsRef;
    Validations registerValidationsRef;

    <span class="keyword">string</span> selectedTab = <span class="string">&quot;login&quot;</span>;

    <span class="keyword">string</span> name;
    <span class="keyword">string</span> email;
    <span class="keyword">string</span> password;
    <span class="keyword">bool</span> rememberMe;

    <span class="keyword">async</span> Task OnLoginClicked()
    {
        <span class="keyword">if</span> ( <span class="keyword">await</span> loginValidationsRef.ValidateAll() )
        {
            <span class="comment">// do the real login here</span>

            <span class="keyword">await</span> loginValidationsRef.ClearAll();
        }
    }

    <span class="keyword">async</span> Task OnRegisterClicked()
    {
        <span class="keyword">if</span> ( <span class="keyword">await</span> registerValidationsRef.ValidateAll() )
        {
            <span class="comment">// do the real login here</span>

            <span class="keyword">await</span> registerValidationsRef.ClearAll();
        }
    }
}
</pre></div>
</div>
